/*
 * Jabberd2-json-libs-java  
 * Copyright (C) 2010 Antti Leppä / Foyt
 * http://www.foyt.fi
 * 
 * License: 
 * 
 * Licensed under GNU General Public License Version 3 (GPL) 
 * http://www.gnu.org/licenses/gpl.html
 */

package fi.foyt.jabberd2json;

import java.util.List;
import java.util.Map;

/**
 * Interface that defines single object set handler 
 */
public interface ObjectSetHandler {
  
  /**
   * Handles retrieval of object sets 
   * 
   * @param owner object sets owner's JID
   * @param filter filter for the results or null of non specified
   * 
   * @return List of ObjectSets matching owner and filter
   */
  public List<ObjectSet> readObjectSets(String owner, Filter filter);
  
  /**
   * Handles update of object set
   * 
   * @param owner object sets owner's JID
   * @param filter filter to specify target object set or null if filter is not defined 
   * @param updateMode Update mode
   * @param values object set's new values as key / value pairs
   */
  public void updateObjectSet(String owner, Filter filter, ObjectSetUpdateMode updateMode, Map<String, String> values);
  
  /**
   * Returns ObjectSetType which this handler is responsible of 
   * 
   * @return ObjectSetType which this handler is responsible of 
   */
  public ObjectSetType getType();  
}
